/**
 * @author Eric Jahn
 * Course: Object Oriented Programming
 * Final Project
 * Due Date: August 3, 2012
 */
package oop.chat.search;

/**
 * enumeration for different search types,
 * will be used to automatically initialize a search class
 * @author Eric Jahn
 */
public enum SearchType {

    NAME("Name"), 
    YEAR("Year"), 
    DEPARTMENT("Department"), 
    COURSE("Course"), 
    LOG("Log");

    /**
     * * this function is called to initialize a new search
     *
     * @return	Object	Search
     */
    public Search getSearch() {
        switch (this) {
            case NAME:
                return new NameSearch(this);
            case YEAR:
                return new YearSearch(this);
            case DEPARTMENT:
                return new DepartmentSearch(this);
            case COURSE:
                return new CourseSearch(this);
            case LOG:
                return new LogSearch(this);
            default:
                return null;
        }
    }
    //label desciption 
    private String menuLabel;

	/**
	 * constructor
	 * @param	label		String 
	 */
    private SearchType(String label) 
	{
        this.menuLabel = label;
    }

    /**
     * gets the menu label of the category     *
     * @return	menulabel	String
     */
    public final String getMenuLabel() 
	{
        return this.menuLabel;
    }
}